/**       
 * @{#} DefaultEvictionPolicy.java Create on 2012-3-29 下午3:08:16       
 *       
 * Copyright (c) 2012 by able.       
 */
package __javable.core.util.pool.impl;


/**
 * 
 * 
 * @history <PRE>
 * --------------------------------------------------------- 
 * VERSION       DATE            BY       CHANGE/COMMENT 
 * --------------------------------------------------------- 
 * 1.0           2012-3-29      able         create 
 * ---------------------------------------------------------
 * </PRE>
 * 
 */
public class DefaultEvictionPolicy<T> implements EvictionPolicy<T> {
	
	@Override
	public boolean evict(EvictionConfig config, PooledObject<T> underTest, int idleCount) {

		if ((config.getIdleSoftEvictTime() < underTest.getIdleTimeMillis() && config.getMinIdle() < idleCount)
				|| config.getIdleEvictTime() < underTest.getIdleTimeMillis()) {
			return true;
		}
		return false;
	}
}
